     {  Petrova Tatjana
        2012 / 11 / 12
        This program can write you the destination between an area and a point . }

program DestinationBetweenAnAreaAndAPoint;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  x1,y1,z1,a,b,c,d,x2,y2,z2,x3,y3,z3, x0,y0,z0,d1: real;


begin
  readln(x1,y1,z1);
  readln(x2,y2,z2);
  readln(x3,y3,z3);
  readln(x0,y0,z0);
  a:=(y1-y2)*(z2-z3)-(y2-y3)*(z1-z2);
  b:=-((x1-x2)*(z2-z3)-(x2-x3)*(z1-z2));
  c:= (x1-x2)*(y2-y3)-(x2-x3)*(y1-y2);
  d:=-(a*x1+b*y1+c*z1);
  d1:=(a*x0+b*x0+c*z0+d)/sqrt(a*a+b*b+c*c);
  writeln(d1);
  readln;
end.
 